import java.util.Scanner;

public class Pinweidafen {
    public static void main(String[] args) {
        //评委打分案例.
        double ave = sore(6);
        System.out.println("最终得分为:"+ave);
    }
    public static double sore(int n){
        Scanner se = new Scanner(System.in);
        int sum = 0;
        int max = 0;
        int min = 100;
        for (int i = 0; i < n; i++) {
            System.out.println("请输入第" + (i+1) + "位评委的打分");
            int point = se.nextInt();
            sum += point;
            if(max < point){
                max = point;
            }
            if(min > point){
                min = point;
            }
        }
        return (sum-max-min)/(n-2.0);
    }
}
